package common.fengkai.filepost.utils;

import cfca.paperless.client.servlet.PaperlessClient;
import cfca.paperless.client.util.PaperlessClientUtil;
import cfca.paperless.util.StringUtil;
import common.fengkai.filepost.conf.PaperlessConfig;

public class CheckEsealSert {

       public static void main(String[] args) throws Exception {

           PaperlessClient paperlessClient = new PaperlessClient("http://10.29.31.124:8151/PaperlessServer/PaperlessServlet",10000,600000);

           byte[] bytes = Base64util.decoderFileTobytes("C:\\Users\\carry\\Desktop\\电子保单测试\\更新后signed55.pdf");
           String systemNo = "100000";
           String verifyStraegyXml= "<Requset><SealVerifyStrategyXml>0<SealVerifyStrategyXml/><Requset/>";
           String verifyPdfSignature = paperlessClient.verifyPdfSignature(systemNo, bytes, verifyStraegyXml, PaperlessConfig.operatorCode, PaperlessConfig.channelCode);
           String code = StringUtil.getXmlField(verifyPdfSignature, "Code");

           // 错误码（Code不等于200时为异常）
           if ("200".equals(code)) {
               System.out.println("VerifyPdfSignatureTest01 END OK");
               System.out.println(verifyPdfSignature);
           } else {
               // 处理结果为异常，打印出错误码和错误信息
               System.out.println("VerifyPdfSignatureTest01 END NG");
               System.out.println(verifyPdfSignature);
           }


       }

}
